package com.gxa.controller;

import com.gxa.common.R;
import com.gxa.pojo.Fkd;
import com.gxa.pojo.Otherpay;
import com.gxa.pojo.Skd;
import com.gxa.service.RecepitPayService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
@RequestMapping("/recepitPay")
@Api(value = "收付款接口",tags = "收付款接口API")
public class RecepitPayController {
    @Autowired
    private RecepitPayService service;
    /**
     * 查询供应商列表：
     */
    @RequestMapping(value = "/queryClientByMsg" , method = RequestMethod.GET)
    @ResponseBody
    public R queryClient(@RequestParam(defaultValue = "1") Integer currentPage,
                         @RequestParam(defaultValue = "10") Integer limit,
                         @RequestParam(defaultValue = "") String clientType ,
                         @RequestParam(defaultValue = "") String msg){
        R r = service.queryClient(currentPage,limit,clientType,msg);
        return r;
    }
    //查询供应商种类
    @RequestMapping(value = "/queryKHType" , method = RequestMethod.GET)
    @ResponseBody
    public R queryKHType(){
        R r = service.queryKHType();
        return r;
    }
    //查询结算账户
    @RequestMapping(value = "/queryJSType",method = RequestMethod.GET)
    @ResponseBody
    public R queryJSType(){
        R r = service.queryJSType();
        return r;
    }
    //查询结算方式
    @RequestMapping(value = "/queryPayType" ,method = RequestMethod.GET)
    @ResponseBody
    public R queryPayType(){
        R r = service.queryPayType();
        return r;
    }
    //分页查询供应商列表
    @RequestMapping(value = "/queryGYSList",method = RequestMethod.POST)
    @ResponseBody
    public R queryGYSList(@RequestBody Map map){
        R r = service.queryGYSList(map);
        return r;
    }
    //查询供应商类别
    @RequestMapping(value = "/queryGYSType" , method = RequestMethod.GET)
    @ResponseBody
    public R queryGYSType(){
        R r = service.queryGYSType();
        return r;
    }
    //查询源单
    @RequestMapping(value = "/queryYDList" , method = RequestMethod.POST)
    @ResponseBody
    public R queryYDList(@RequestBody Map map){
        R r = service.queryYDList(map);
        return r;
    }
    //提交付款单和收款单
    @RequestMapping(value = "/addReceiptPaySkd",method = RequestMethod.POST)
    @ResponseBody
    public R addReceiptPaySkd(@RequestBody Skd skd){
        R r = service.addReceiptPaySkd(skd);
        return r;
    }
    //添加收款单
    @RequestMapping(value = "/addReceiptPayFkd" ,method = RequestMethod.POST)
    @ResponseBody
    public R addReceiptPayFkd(@RequestBody Fkd fkd){
        R r = service.addReceiptPayFkd(fkd);
        return r;
    }
    //添加其他收支单
    @RequestMapping(value = "/addOtherPay" ,method = RequestMethod.POST)
    @ResponseBody
    public R addOtherPay(@RequestBody Otherpay otherpay){
        R r = service.addOtherPay(otherpay);
        return r;
    }
    //查询其他支入支出
    //查询多条
    @RequestMapping(value = "/queryOtherPayList",method = RequestMethod.GET)
    @ResponseBody
    public R queryOtherPayList(Integer status){
        R r = service.queryOtherPayList(status);
        return r;
    }
    //查询具体的其他收支
    @RequestMapping(value = "/qeryDetailsOtherPay" , method = RequestMethod.GET)
    public R qeryDetailsOtherPay(String num){
        R r = service.qeryDetailsOtherPay(num);
        return r;
    }



















    //查询收入类别
    @RequestMapping(value = "/querySRType" , method = RequestMethod.GET)
    @ResponseBody
    public R querySRType(){
        R r =service.querySRType();
        return r;
    }
    //查询支出的类别
    @RequestMapping(value = "/queryZCType",method = RequestMethod.GET)
    @ResponseBody
    public R queryZCType(){
        R r = service.queryZCType();
        return r;
    }
    //查询收付款单
    @RequestMapping(value = "/querySkdList" , method = RequestMethod.POST)
    @ResponseBody
    public R querySkdList(@RequestBody Map map){
        R r = service.querySkdList(map);
        return r;
}
    //具体数据回显
    @RequestMapping(value = "/receiptDetails" , method = RequestMethod.GET)
    @ResponseBody
    public R receiptDetails(Integer status, String num){
        R r = service.receiptDetails(status,num);
        return r;
    }
}
